﻿@model SmartParking.Models.ReservationModel

@{
    System.Threading.Thread.CurrentThread.CurrentUICulture = Session["Culture"] as System.Globalization.CultureInfo;
    ViewBag.Title = SmartParking.Resources.Home.Reservations.Title;
    List<SmartParking.Data.Entities.OrderDetail> reservations = ViewBag.Reservations as List<SmartParking.Data.Entities.OrderDetail>;
}

<div class="template_container">
    <div class="template_container_top">
        <p>
            <img src="../../Content/media/img/paso1.jpg" alt=""/>
        </p>
        <div class="template_container_top_left">
            <div class="panel">
                <fieldset>
                    <legend>@SmartParking.Resources.Home.Reservations.ParkingInfo</legend>
                    <div>
                        @Html.DisplayNameFor(modelItem => Model.ParkingName)
                        @Html.DisplayNameFor(modelItem => Model.ParkingZoneName)
                    </div>
                </fieldset>                
            </div>
        </div>
        <div class="template_container_top_right">
            <div class="panel">
                <fieldset>
                    <legend>@SmartParking.Resources.Home.Reservations.ReservationInfo</legend>
                    <div>
                        @Html.DisplayNameFor(modelItem => Model.Date)
                        @Html.EditorFor(modelItem => Model.Date)
                        @Html.DisplayNameFor(modelItem => Model.CarPlate)
                        @Html.EditorFor(modelItem => Model.CarPlate)
                    </div>
                </fieldset>
            </div>
        </div>
    </div>
    <div class="template_container_bottom">
        <div>
            <table>
                <tr>
                    <th></th>
                    <th>@Html.DisplayNameFor(modelItem => Model.ParkingName)</th>
                    <th>@Html.DisplayNameFor(modelItem => Model.ParkingZoneName)</th>
                    <th>@Html.DisplayNameFor(modelItem => Model.CarPlate)</th>
                    <th>@Html.DisplayNameFor(modelItem => Model.Date)</th>
                    <th>@Html.DisplayNameFor(modelItem => Model.StartDateTime)</th>
                    <th>@Html.DisplayNameFor(modelItem => Model.EndDateTime)</th>
                    <th>@Html.DisplayNameFor(modelItem => Model.Amount)</th>
                    <th>@Html.DisplayNameFor(modelItem => Model.Commission)</th>
                </tr>
            @foreach (var item in reservations)
            {
                <tr>
                    <td>@Html.DisplayFor(modelItem => item.ParkingZone.Parking.Name)</td>
                    <td>@Html.DisplayFor(modelItem => item.ParkingZone.Name)</td>
                    <td>@Html.DisplayFor(modelItem => item.CarPlate)</td>
                    <td>@Html.DisplayFor(modelItem => item.ReservationStartDateTime)</td>
                    <td>@Html.DisplayFor(modelItem => item.ReservationStartDateTime)</td>
                    @*TODO: Replace ReservationDateTime to ReservationEndDateTime*@
                    <td>@Html.DisplayFor(modelItem => item.ReservationDateTime)</td>
                    <td>@Html.DisplayFor(modelItem => item.Amount)</td>
                    <td>@Html.DisplayFor(modelItem => item.Commission)</td>
                </tr>
            }
            </table>
        </div>
    </div>
</div>